package floappcontest.core.beans;

import java.io.Serializable;

import javax.persistence.Column;

import floappcontest.core.beans.interfaces.PersistentObject;


public class FaqPK implements Comparable<FaqPK>, Serializable, PersistentObject {

	private static final long serialVersionUID = 1L;
	private String contestName;
	private String question;


	public FaqPK() {
		// Default empty constructor
		contestName = new String();
		question = new String();
	}


	public FaqPK( String contestName, String question ) {
		this.contestName = contestName;
		this.question = question;
	}


	@Column( name = "contestName", length = 255, nullable = false )
	public String getContestName() {
		return this.contestName;
	}


	public void setContestName( String contestName ) {
		this.contestName = contestName;
	}


	@Column( name = "question", length = 255, nullable = false )
	public String getQuestion() {
		return this.question;
	}


	public void setQuestion( String question ) {
		this.question = question;
	}


	public int compareTo( FaqPK faqPK ) {
		if ( getContestName().compareTo( faqPK.getContestName() ) != 0 ) {
			return getContestName().compareTo( faqPK.getContestName() );
		}
		return getQuestion().compareTo( faqPK.getQuestion() );
	}


	public boolean equals( Object o ) {
		if ( o instanceof FaqPK ) {
			FaqPK fpk = (FaqPK) o;
			return (getQuestion().equals( fpk.getQuestion() ) && (getContestName()
					.equals( fpk.getContestName() )));
		}
		return false;
	}

}
